<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
	    <title>改变地图中心点及缩放级别</title>
	    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
	    <script src="http://webapi.amap.com/maps?v=1.3&key=e06178925b8ec4746ca36a53593d07dd"></script>
	    <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
	</head>
	<body>
		<div id="container"></div>
		<div class="button-group">
		    <input id="setCenter" type="button" class="button" value="改变地图中心点及缩放级别"/>
		</div>
		<script>
		    var map = new AMap.Map('container', {
		        resizeEnable: true,
		        center: [117.002296,36.647165],
		        zoom: 13
		    });
		    AMap.event.addDomListener(document.getElementById('setCenter'), 'click', function() {
		        // 设置缩放级别和中心点
		        map.setZoomAndCenter(14, [117.002296,36.647165]);
		        // 在新中心点添加 marker 
		        var marker = new AMap.Marker({
		            map: map,
		            position: [117.002296,36.647165]
		        });
		    });
		</script>
	</body>
</html>
